﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shCore.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushCSharp.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushXml.js"></script>
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCore.css" />
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCoreEclipse.css" />
    <script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body>
    <h3>Dos.ORM</h3>
    <p>
        上手简单，0学习成本。使用方便，按照sql书写习惯编写C#.NET代码。功能强大。<br />
        高性能，接近手写Sql。<br />
        体积小（不到150kb，仅一个dll）。<br />
        完美支持Sql Server(2000至最新版),MySql,Oracle,Access,Sqlite等数据库。<br />
        支持大量Lambda表达式写法，国产ORM支持度最高，开源中国ORM排行前三。<br />
        不需要像NHibernate的XML配置，不需要像EF的各种数据库连接驱动。<br />
        众多成熟企业软件、互联网项目已应用此框架。<br />
        遵循MIT开源协议，除不允许改名，其它随意定制修改。<br />
        Dos团队持续更新升级，任何Bug反馈都会立即得到解决。<br />
    </p>
    <b>一句代码配置：</b>
    <pre class="brush:csharp;">
        public class DB{public static readonly DbSession Context = new DbSession("connectionStringsName");}
    </pre>
    <b>开始使用：</b>
    <pre class="brush:csharp;">
        DB.Context.From&lt;Model.table1>()    //Model.table1类通过Dos.ORM实体生成器生成
        .Select(d => new { d.id, d.price })
            //Sql：SELECT id,price FROM table1
        //.Select&lt;table2,table3>((a,b,c) => a.id, b.name, c.sex)
            //Sql：SELECT table1.id, table2.name, table3.sex
        .LeftJoin&lt;table2>((a, b) => a.id == b.id)
            //Sql：LEFT JOIN Table2 ON table1.id = table2.id
        .Where(d => (d.id != 2 && d.name.In("com","net")) || d.sex != null)    
            //Sql：WHERE (id &lt;> 2 AND name IN('com','net')) OR sex IS NOT NULL
        .GroupBy(d => new { d.name, d.sex })    //Sql：GROUP BY name,sex
        .OrderBy(d => new { d.createTime, d.name })
            //Sql：ORDER BY createTime,name
        .Having(d => d.name != '')    //Sql：HAVING name &lt;> ''
        .Top(5)    //取前5条数据
        .Page(10, 2)    //每页10条数据，取第2页
        .ToList();    //默认返回List&lt;table1>，也可自定义Map类.ToList&lt;T>();
    </pre>
    <a href="http://www.itdos.com/dos/orm/index.html">帮助文档</a>
</body>
</html>